package com.mark.design.principle.openclose;

/**
 * author:Mark
 * date:2018/8/19  22:10
 * 扩展业务：计算打折
 * 不修改原来的接口和类
 * 通过继承实现
 */
public class JavaDisCountCourse extends JavaCourse {

    public JavaDisCountCourse(Integer id, String name, Double price) {
        super(id, name, price);
    }

    @Override
    public Double getPrice() {//返回打折的价格
        return super.getPrice()*0.8;
    }

    public Double getOriginPrice() {//返回原价
        return super.getPrice();
    }
}
